import {images} from '@/mock';
import {createStore} from 'vuex';

// default store instance
export default createStore({
  state() {
    return {
        images,
        currImage: images[0],
        instance: null
    }
  },
  mutations: {
    changeImage(state, imageUrl) {
        state.currImage = imageUrl;
    },
    changeInstance(state, newInstance = {}) {
      state.instance = {...(state.instance || {}), ...newInstance}
    }
  }
});